Skip to content

Conversation

@arlen
Copy link
Contributor

@arlen arlen commented Jul 28, 2026

This PR solves two problems:

  1. The ./bin/cake database command was failing with: [Cake\Database\Exception\QueryException] [default] SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "plugins" does not exist
    The QueryException was not being caught.
  2. The './bin/cake setup' command was subsequently failing on the new NormalizationBehavior.

@arlen arlen requested review from Ioannis and benno July 28, 2026 16:39
@arlen arlen force-pushed the feature-cfm535-databaseAndSetupScriptFixes branch from 2c976c1 to 226f1ea Compare August 19, 2026 12:59
@arlen
Copy link
Contributor Author

arlen commented Aug 19, 2026

rebased agasinst latest develop

@Ioannis
Copy link
Contributor

Ioannis commented Aug 20, 2026

@benno do we need normalization to run during the setup?

Comment on lines 68 to 75
$entityOptions = [];
foreach($options as $k => $v) {
$entityOptions[$k] = $v;
}
$entityOptions['skipNormalization'] = true;

// This will recurse, so make sure to break the loop
$entity = $Table->newEntity((array)$data, options: ['skipNormalization' => true]);
$entity = $Table->newEntity((array)$data, options: $entityOptions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could more concisely use something like

$Table->newEntity((array)$data, options: array_merge($options, ['skipNormalization' => trp.]));

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benno since we are going compact, we should better use the unpacking:

$entity = $Table->newEntity(
    (array)$data,
    options: [...$options, 'skipNormalization' => true]
);

since the skipNormalization is placed after the $options it will always override whatever $options have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source has been updated to use the unpacking approach.

@benno
Copy link
Contributor

benno commented Sep 6, 2026

@benno do we need normalization to run during the setup?

I'm not sure we need it, though it might be nice to have. If an admin puts an extra space in their name, is there a reason not to remove it?

@Ioannis
Copy link
Contributor

Ioannis commented Sep 8, 2026

@benno do we need normalization to run during the setup?

I'm not sure we need it, though it might be nice to have. If an admin puts an extra space in their name, is there a reason not to remove it?

Good point

@Ioannis Ioannis requested review from Ioannis and benno September 8, 2026 12:13
@benno benno merged commit e50b64c into COmanage:develop Sep 8, 2026
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants